package com.oxy.util;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class LogManager {
	// a reference to Oxy.getCfgManager()
	private ConfigManager cfgRef;
	
	public LogManager(ConfigManager cfg) {
		cfgRef = cfg;
		init();
	}
	private void init() {
		PropertyConfigurator.configure(cfgRef.App().CFG_LOG);
	}
	
	public Logger getLoggerCommon() {
		return Logger.getLogger(cfgRef.Log().LOG_COMMON);
	}
	
	public Logger getLoggerAccess() {
		return Logger.getLogger(cfgRef.Log().LOG_ACCESS);
	}
	
	public Logger getLogger(String name) {
		return Logger.getLogger(name);
	}
	
	public Logger getLogger(Class cls) {
		return Logger.getLogger(cls);
	}
}
